<html>
<head>
<title>300px Body</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {font-weight: bold}
.style2 {color: #FF0000}
.style3 {font-weight: bold; color: #FF0000; }
.style4 {color: #000000}
-->
.error_strings{ font-family:Verdana; font-size:10px; color:#660000;}
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (300px Body.jpg) -->
<script language="javaScript" type="text/javascript" src="../calander/calendar.js"></script>
<link href="../calander/calendar.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../logic/validation/validation.js" type="text/javascript"></script>
<script language="javascript" src="../logic/validation/att_employee_update.js" type="text/javascript"></script>

<?php        
$id=$_GET['edit'];
$tag=$_GET['tag'];
$startrow=$_GET['startrow'];


include'../logic/Classes/db.php';
	
$x=new Dbconnect();
	
$con=$x->getConnection();

$sql1="Select emp_no,inn,outt,attend_date from  employee_attend where att_id='$id'";

$result= mysql_query($sql1,$con) or die(mysql_error());
while($row=mysql_fetch_array($result)) {

 $dt1=$row['attend_date'];
		$month=substr($dt1,5,2);
		$year=substr($dt1,0,4);
		$day=substr($dt1,8,2);
}

$sql2="Select emp_no,inn,outt,attend_date from  employee_attend where att_id='$id'";

$result2= mysql_query($sql1,$con) or die(mysql_error());
?>
<?php while($row=mysql_fetch_array($result2)) {?>

<table width="800" height="173" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
	<tr>
		<td><img src="../images/emp_att_update.gif" width="800" height="69" alt=""></td>
    </tr>
	<tr >
		<td height="64" background="../images/2.gif" style="background-repeat:repeat-y">
    		<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
				<form id="myForm" onSubmit="return validate()">
      				<tr>
        				<td width="79" height="25">&nbsp;</td>
        				<td width="165" ><div align="right"><strong>Employee No</strong> <span class="style3">*</span> </div></td>
        				<td colspan="4" ><input name="txtEmpno" type="text" id="txtEmpno" value="<?php echo $row['emp_no']; ?>" onBlur="checkempno()">
          					<input name="txtStartrow" type="hidden" id="startrow" value="<?php echo $startrow; ?>">
          					<input name="txtId" type="hidden" id="id" value="<?php echo $id; ?>">
          					<input name="txtTag" type="hidden" id="tag" value="<?php echo $tag; ?>"></td>
        				<td width="203" >Required <span class="style4">Field </span><span class="style1"><span class="style2">* </span></span></td>
      				</tr>
      				<tr>
        				<td height="19">&nbsp;</td>
        				<td>&nbsp;</td>
        				<td colspan="4"><div id="ajaxDiv1" class="error_strings"></div></td>
        				<td>&nbsp;</td>
      				</tr>
     				<?php 
	   				$attend_date=$day."-".$month."-".$year;
					?>
      				<tr>
        				<td height="25">&nbsp;</td>
        				<td><div align="right"><strong>Attended Date</strong> <span class="style3">* </span></div></td>
        				<td colspan="4"><input type="text" name="txtDy" id="txtDy" value="<?php echo "$attend_date"; ?>">
        				<a href="#" onClick="setYears(1985, 2012);
       					showCalender(this, 'txtDy');">
      					<img src="../calander/calender.png" width="24" height="20"></a>

    <!-- Calender Script  --> 

    <table id="calenderTable">
        <tbody id="calenderTableHead">
          <tr>
            <td colspan="4" align="center">
	          <select onChange="showCalenderBody(createCalender(document.getElementById('selectYear').value,
	           this.selectedIndex, false));" id="selectMonth">
	              <option value="0">Jan</option>
	              <option value="1">Feb</option>
	              <option value="2">Mar</option>
	              <option value="3">Apr</option>
	              <option value="4">May</option>
	              <option value="5">Jun</option>
	              <option value="6">Jul</option>
	              <option value="7">Aug</option>
	              <option value="8">Sep</option>
	              <option value="9">Oct</option>
	              <option value="10">Nov</option>
	              <option value="11">Dec</option>
	          </select>
            </td>
            <td colspan="2" align="center">
			    <select onChange="showCalenderBody(createCalender(this.value,document.getElementById('selectMonth').selectedIndex, false));" id="selectYear">
				</select>
			</td>
            <td align="center">
			    <a href="#" onClick="closeCalender();"><font color="#003333" size="+1">X</font></a>
			</td>
		  </tr>
       </tbody>
       <tbody id="calenderTableDays">
         <tr style="">
           <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
         </tr>
       </tbody>
       <tbody id="calender"></tbody>
    </table>

<!-- End Calender Script  --></td>
        			<td>&nbsp;</td>
      			</tr>
      			<tr>
        			<td height="19">&nbsp;</td>
        			<td>&nbsp;</td>
        			<td width="53">&nbsp;</td>
        			<td colspan="3">&nbsp;</td>
        			<td>&nbsp;</td>
      			</tr>
      			<tr>
        			<td height="25">&nbsp;</td>
        			<td><div align="right"><strong>In <span class="style2">*</span> </strong></div></td>
        			<td colspan="4"><select name="sltIn" id="sltIn">
         				<option value="09.00 AM" <?php if ($row['inn']=="09.00 AM") { ?>selected="selected" <?php } ?>>09.00 AM</option>
          				<option value="09.30 AM"<?php if ($row['inn']=="09.30 AM") { ?>selected="selected" <?php } ?> >09.30 AM</option>
		  				<option value="10.00 AM"<?php if ($row['inn']=="10.00 AM") { ?>selected="selected" <?php } ?> >10.00 AM</option>
          				<option value="10.30 AM" <?php if ($row['inn']=="10.30 AM") { ?>selected="selected" <?php } ?>>10.30 AM</option>
		  				<option value="11.00 AM" <?php if ($row['inn']=="11.00 AM") { ?>selected="selected" <?php } ?>>11.00 AM</option>
		  				<option value="11.30 AM" <?php if ($row['inn']=="11.30 AM") { ?>selected="selected" <?php } ?>>11.30 AM</option>
          				<option value="12.30 PM"<?php if ($row['inn']=="12.30 PM") { ?>selected="selected" <?php } ?> >12.30 PM</option>
		  				<option value="01.00 PM"<?php if ($row['inn']=="01.00 PM") { ?>selected="selected" <?php } ?>>01.00 PM</option>
		  				<option value="01.30 PM"<?php if ($row['inn']=="01.30 PM") { ?>selected="selected" <?php } ?> >01.30 PM</option>
		  				<option value="02.00 PM"<?php if ($row['inn']=="02.00 PM") { ?>selected="selected" <?php } ?>>02.00 PM</option>
          				<option value="02.30 PM" <?php if ($row['inn']=="02.30 PM") { ?>selected="selected" <?php } ?>>02.30 PM</option>
		  				<option value="03.00 PM"<?php if ($row['inn']=="03.00 PM") { ?>selected="selected" <?php } ?>>03.00 PM</option>
	        			<option value="03.30 PM" <?php if ($row['inn']=="03.30 PM") { ?>selected="selected" <?php } ?>>03.30 PM</option>
	   					<option value="04.00 PM" <?php if ($row['inn']=="04.00 PM") { ?>selected="selected" <?php } ?>>04.00 PM</option>
	        			<option value="04.30 PM" <?php if ($row['inn']=="04.30 PM") { ?>selected="selected" <?php } ?> >04.30 PM</option>
	    				</select></td>
        		<td>&nbsp;</td>
      		</tr>
      		<tr>
        		<td height="19">&nbsp;</td>
        		<td>&nbsp;</td>
        		<td colspan="4">&nbsp;</td>
        		<td>&nbsp;</td>
      		</tr>
     		<tr>
        		<td height="25">&nbsp;</td>
        		<td><div align="right"><strong>Out</strong> <span class="style2">* </span></div></td>
        		<td colspan="4"><select name="sltOut" id="sltOut">
           			<option value="11.00 AM" <?php if ($row['outt']=="11.00 AM") { ?>selected="selected" <?php } ?>>11.00 AM</option>
		  			<option value="11.30 AM" <?php if ($row['outt']=="11.30 AM") { ?>selected="selected" <?php } ?>>11.30 AM</option>
          			<option value="12.30 PM"<?php if ($row['outt']=="12.30 PM") { ?>selected="selected" <?php } ?> >12.30 PM</option>
		  			<option value="01.00 PM"<?php if ($row['outt']=="01.00 PM") { ?>selected="selected" <?php } ?>>01.00 PM</option>
		  			<option value="01.30 PM"<?php if ($row['outt']=="01.30 PM") { ?>selected="selected" <?php } ?> >01.30 PM</option>
		  			<option value="02.00 PM"<?php if ($row['outt']=="02.00 PM") { ?>selected="selected" <?php } ?>>02.00 PM</option>
          			<option value="02.30 PM" <?php if ($row['outt']=="02.30 PM") { ?>selected="selected" <?php } ?>>02.30 PM</option>
		  			<option value="03.00 PM"<?php if ($row['outt']=="03.00 PM") { ?>selected="selected" <?php } ?>>03.00 PM</option>
	        		<option value="03.30 PM" <?php if ($row['outt']=="03.30 PM") { ?>selected="selected" <?php } ?>>03.30 PM</option>
	   				<option value="04.00 PM" <?php if ($row['outt']=="04.00 PM") { ?>selected="selected" <?php } ?>>04.00 PM</option>
	        		<option value="04.30 PM" <?php if ($row['outt']=="04.30 PM") { ?>selected="selected" <?php } ?> >04.30 PM</option>
	   				<option value="05.00 PM"<?php if ($row['outt']=="05.00 PM") { ?>selected="selected" <?php } ?>>05.00 PM</option>
	        		<option value="05.30 PM"<?php if ($row['outt']=="05.30 PM") { ?>selected="selected" <?php } ?>>05.30 PM</option>
	        		<option value="06.00 PM" <?php if ($row['outt']=="06.00 PM") { ?>selected="selected" <?php } ?>>06.00 PM</option>
	       			<option value="06.30 PM"<?php if ($row['outt']=="06.30 PM") { ?>selected="selected" <?php } ?>>06.30 PM</option>
					<option value="07.00 PM" <?php if ($row['outt']=="07.00 PM") { ?>selected="selected" <?php } ?>>07.00 PM</option>
	        		<option value="07.30 PM"<?php if ($row['outt']=="07.30 PM") { ?>selected="selected" <?php } ?> >07.30 PM</option>
	            	</select></td>
        		<td>&nbsp;</td>
      		</tr>
      		<tr>
        		<td height="19">&nbsp;</td>
        		<td>&nbsp;</td>
        		<td colspan="3"><div id="ajaxDiv" class="error_strings"> </div>  </td>
        		<td width="130">&nbsp;</td>
        		<td>&nbsp;</td>
      		</tr>
	  	  			<?php } ?>
      		<tr>
        		<td height="25">&nbsp;</td>
        		<td>&nbsp;</td>
        		<td colspan="2"><input name="Save" type="submit" id="Save" value="Submit" ></td>
        		<td width="107"><input type="reset" name="Reset" value="Back" onClick="backxx()"></td>
        		<td>&nbsp;</td>
        		<td>&nbsp;</td>
      		</tr>
	  	  </form>
    	</table>
	  </td>
	</tr>
	<tr>
		<td>
			<img src="../images/3.gif" width="800" height="40" alt=""></td>
	</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>